package me.zhengjie.modules.monitor.config;

import lombok.extern.slf4j.Slf4j;
import me.zhengjie.modules.monitor.service.VisitsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * Description: 初始化站点统计 .<br>
 *
 * @author jm
 * @since 2020/1/20
 */
@Slf4j
@Component
public class VisitsInitialization implements ApplicationRunner {
    @Autowired private VisitsService visitsService;

    @Override
    public void run(ApplicationArguments args) {
        visitsService.save();
        log.debug("[Monitor] 初始化站点统计完成");
    }
}
